# 非线性波束成形主程序
import argparse
from typing import Dict

def main(params:Dict = {}) -> None:
    print(f'非线性波束成形研究平台 v0.0.2')
    if params['version'] == 1:
        from apps.nlbf.nlbf_app_v1 import NlbfApp
    elif params['version'] == 2:
        from apps.nlbf.nlbf_app_v2 import NlbfApp
    elif params['version'] == 3:
        from apps.nlbf.nlbf_app_v3 import NlbfApp
    elif params['version'] == 4:
        from apps.nlbf.nlbf_app_v4 import NlbfApp
    elif params['version'] == 5:
        from apps.nlbf.nlbf_app_v5 import NlbfApp
    elif params['version'] == 6:
        from apps.nlbf.nlbf_app_v6 import NlbfApp
    NlbfApp.startup(params=params)

def parse_args() -> argparse.Namespace:
    parser = argparse.ArgumentParser()
    parser.add_argument(
        '--run_mode', action='store',
        type=int, default=1, dest='run_mode',
        help='run mode'
    )
    parser.add_argument(
        '--version', action='store',
        type=int, default=1, dest='version',
        help='version'
    )
    return parser.parse_args()

if '__main__' == __name__:
    args = parse_args()
    params = vars(args)
    main(params=params)